package controllers

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"goconfcenter/core/consts"
	"goconfcenter/core/response"
	"goconfcenter/service"
	"goconfcenter/service/dto/bus"
)

type OperationLogController struct {
}

func (c *OperationLogController) DataGrid(ctx *gin.Context) {
	params := new(bus.OperationLogQuery)
	if err := ctx.ShouldBindJSON(params); err != nil {
		zap.L().Error("请求参数异常", zap.Error(err))
		response.ErrorParam(ctx, "")
		return
	}
	data, total := service.OperationLogServiceInstance().PageByQuery(params)
	var pageData response.PageData
	pageData.Data = data
	pageData.Total = total
	response.Success(ctx, consts.CurdStatusOkMsg, pageData)
}
